package com.zby.CloudGallery.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zby.CloudGallery.model.dto.picture.*;
import com.zby.CloudGallery.model.entity.PictureEntity;
import com.zby.CloudGallery.model.entity.UserEntity;
import com.zby.CloudGallery.model.vo.PictureVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 图片
 *
 * @author zby
 * @email 2069189112@qq.com
 * @date 2025-02-13 22:01:11
 */
public interface PictureService extends IService<PictureEntity> {
    /**
     * 校验图片
     *
     * @param picture
     */
    void validPicture(PictureEntity picture);

    /**
     * 上传图片
     *
     * @param inputSource          文件输入源
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
//    PictureVO uploadPicture(Object inputSource,
//                            PictureUploadRequest pictureUploadRequest,
//                            UserEntity loginUser);
    /**
     * 上传图片
     *
     * @param inputSource
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(Object inputSource,
                            PictureUploadRequest pictureUploadRequest,
                            UserEntity loginUser);

    /**
     * 获取图片包装类（单条）
     *
     * @param picture
     * @param request
     * @return
     */
    PictureVO getPictureVO(PictureEntity picture, HttpServletRequest request);

    /**
     * 获取图片包装类（分页）
     *
     * @param picturePage
     * @param request
     * @return
     */
    Page<PictureVO> getPictureVOPage(Page<PictureEntity> picturePage, HttpServletRequest request);

    /**
     * 获取查询对象
     *
     * @param pictureQueryRequest
     * @return
     */
    QueryWrapper<PictureEntity> getQueryWrapper(PictureQueryRequest pictureQueryRequest);


    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, UserEntity loginUser);

    /**
     * 填充审核参数
     *
     * @param picture
     * @param loginUser
     */
    void fillReviewParams(PictureEntity picture, UserEntity loginUser);

    /**
     * 批量抓取和创建图片
     *
     * @param pictureUploadByBatchRequest
     * @param loginUser
     * @return 成功创建的图片数
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest,
                                 UserEntity loginUser);

    /**
     * 清理图片文件
     *
     * @param oldPicture
     */
    void clearPictureFile(PictureEntity oldPicture);

    /**
     * 删除图片
     *
     * @param pictureId
     * @param loginUser
     */
    void deletePicture(long pictureId, UserEntity loginUser);

    /**
     * 编辑图片
     *
     * @param pictureEditRequest
     * @param loginUser
     */
    void editPicture(PictureEditRequest pictureEditRequest, UserEntity loginUser);

    /**
     * 校验空间图片的权限
     *
     * @param loginUser
     * @param picture
     */
    void checkPictureAuth(UserEntity loginUser, PictureEntity picture);

//    /**
//     * 根据颜色搜索图片
//     *
//     * @param spaceId
//     * @param picColor
//     * @param loginUser
//     * @return
//     */
//    List<PictureVO> searchPictureByColor(Long spaceId, String picColor, UserEntity loginUser);
//
//    /**
//     * 批量编辑图片
//     *
//     * @param pictureEditByBatchRequest
//     * @param loginUser
//     */
//    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, UserEntity loginUser);
//
//    /**
//     * 创建扩图任务
//     *
//     * @param createPictureOutPaintingTaskRequest
//     * @param loginUser
//     */
//    CreateOutPaintingTaskResponse createPictureOutPaintingTask
//    (CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, UserEntity loginUser);
}

